import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout/home'
  },
  {
    path: '/login',
    component: () => import('@/views/login.vue')
  },
  {
    path: '/collect',
    component: () => import('@/views/mycollect.vue')
  },
  {
    path: '/register',
    component: () => import('@/views/register.vue')
  },
  {
    path: '/housrdetails',
    component: () => import('@/views/houseDetails.vue')
  },
  {
    path: '/mylease',
    component: () => import('@/views/myLease.vue')
  },
  {
    path: '/citylist',
    component: () => import('@/views/cityList.vue')
  },
  {
    path: '/houseRelease',
    component: () => import('@/views/houseRelease.vue')
  },
  {
    path: '/cityMap',
    component: () => import('@/views/cityMap.vue')
  },
  {
    path: '/estate',
    component: () => import('@/views/estate.vue')
  },
  {
    path: '/layout',
    component: () => import('@/views/layout.vue'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        component: () => import('@/views/home.vue')
      },
      {
        path: 'houstList',
        component: () => import('@/views/houseList.vue')
      },
      {
        path: 'news',
        component: () => import('@/views/news.vue')
      },
      {
        path: 'my',
        component: () => import('@/views/my.vue')
      }
    ]
  },
  {
    path: '*',
    component: () => import('@/views/NotFound.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
